//
//  UserMessageCell.m
//  pmmSS
//
//  Created by Mac book on 2017/9/19.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "UserMessageCell.h"

@implementation UserMessageCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubViews];
    }
    return self;

}

-(void)initSubViews{

    WeakSelf(weakSelf);

    _titleLabel = [HMLabel createLabelWithText:@"dsaf" andTextColor:RGBA(102, 102, 102, 1) andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleH(14)] andTextAlignment:NSTextAlignmentLeft];

    [self.contentView addSubview:_titleLabel];


    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.left.mas_equalTo(autoScaleW(10));

        make.height.mas_equalTo(autoScaleW(20));

        make.width.mas_equalTo(autoScaleH(100));
        
    }];

    _subLabel = [HMLabel createLabelWithText:@"asdfasf" andTextColor:RGBA(102, 102, 102, 1) andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleH(14)] andTextAlignment:NSTextAlignmentRight];

    [self.contentView addSubview:_subLabel];


    [_subLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.right.mas_equalTo(autoScaleW(-30));

        make.height.mas_equalTo(autoScaleW(20));

        make.width.mas_equalTo(autoScaleH(150));
        
    }];


    UIView *lineView = [[UIView alloc]init];

    lineView.backgroundColor = RGBA(245, 244, 247, 1);
    [self.contentView addSubview:lineView];


    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {

        make.top.mas_equalTo(weakSelf.contentView.mas_bottom).offset(autoScaleH(-0.5));


        make.height.mas_equalTo(autoScaleH(0.5));

        make.width.mas_equalTo(weakSelf.contentView);
        
    }];

    UIImageView *rightImage = [[UIImageView alloc]init];

    [rightImage setImage:[UIImage imageNamed:@"icon_arrow_right_gray"]];
    [self.contentView addSubview:rightImage];

    [rightImage mas_makeConstraints:^(MASConstraintMaker *make) {

        make.centerY.mas_equalTo(weakSelf.contentView);
        make.right.mas_equalTo(weakSelf.contentView).offset(autoScaleW(-15));

        make.height.mas_equalTo(autoScaleW(18));
        
        make.width.mas_equalTo(autoScaleH(9));
        
    }];

    
    
}
-(void)layoutSubviews{


}

@end
